package com.javasm.springmybatis;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement;

@SpringBootApplication
//开启事务  ：两个注解  @EnableTransactionManagement + @Transactional
@EnableTransactionManagement  //开启事务第一步：
//配置mapper
//@MapperScan注解里面放的是数组,中括号里面可以填多个字符串
//是同包同目录时的配置
//可以扫描到AdminMapper，也可以扫描到AdminMapper.xml文件
//要求mapper与xml同包同目录
@MapperScan(basePackages = {"com.javasm.springmybatis.mapper"})
//@EnableAsync //第一步：开启异步任务

@EnableScheduling  //第一步：开启定时任务调度
public class SpringMybatisApplication {

    public static void main(String[] args) {
        SpringApplication.run(SpringMybatisApplication.class, args);
    }

}
